package cn.qingyun.gis.modules.enterprise.constant.enums;

import cn.qingyun.gis.utils.oConvertUtils;

/**
 * @description: 图层枚举类
 * @author skb
 * @date 2024/4/10 10:43
 */
public enum LayerEnum {

    COMMUNITY("6", "community"),

    VILLAGE("7", "village"),

    BASE_STATION("8", "base_station"),

    SPLITTING_BOX("9", "splitting_box");

    private String type;
    private String table;


    LayerEnum(String type, String table) {
        this.type = type;
        this.table = table;
    }

    /**
     * @description: 根据类型名称获取表名
     * @author skb
     * @date 2023/12/4 18:31
     */
    public static String getTableByType(String type) {
        if (oConvertUtils.isEmpty(type)) {
            return null;
        }
        for (LayerEnum anEnum : values()) {
            if (type.equals(anEnum.getType())) {
                return anEnum.getTable();
            }
        }
        return null;
    }

    public String getType() {
        return type;
    }

    public String getTable() {
        return table;
    }

}
